<template>
	<view class="uni-status-bar" :style="style">
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: 'StatusBar',
		title: '状态栏',
		props: {
			backgroundColor: {
				type: String,
				default: ''
			}
		},
		computed: {
			style() {
				//#ifdef MP-WEIXIN
				let systemInfo = uni.getSystemInfoSync()
				return `height:${systemInfo.statusBarHeight}px; background-color: ${this.backgroundColor}`
				//#endif
				//#ifdef APP-PLUS
				return `background-color: ${this.backgroundColor}`
				//#endif
			}
		},
		data() {
			return {
				
			};
		},
		mounted() {
		},
	}
</script>

<style lang="scss" scoped>
	.uni-status-bar {
	    display: block;
	    width: 100%;
	    height: 20px;
	    height: var(--status-bar-height);
	}
</style>
